
<div class="content-section introduction  ">
  <div>
    <span class="feature-title">报障管理<span class="gt">&gt;</span>历史报障  </span>
  </div>
</div>

<div class="content-section implementation GridDemo history" >
  <div class="ui-g ">
    <div class="ui-g-12 ui-md-12 ui-lg-12 ">
  <div class="mysearch">
      <div class="ui-g">
        <div class="ui-g-4 ui-sm-12">
          <label class="ui-g-3 ui-sm-5 text-right">故障所属:</label>
          <div class="ui-g-3  ui-sm-7 ui-fluid">
            <input pInputText type="text" name="sid" placeholder="故障所属" [(ngModel)]="queryModel.fault_type" />
          </div>
          <label class="ui-g-3 ui-sm-5 ui-no-padding-left-15px text-right">报障人:</label>
          <div class="ui-g-3 ui-sm-7 ui-fluid  ui-no-padding-right-15px ">
            <input  pInputText type="text" name="status" placeholder="报障人"  [(ngModel)]="queryModel.people" />
          </div>
        </div>
        <div class="ui-g-4 ui-sm-12">
          <label class="ui-g-3 ui-sm-5 text-right">报障时间:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid">
            <p-calendar  [showIcon]="true" [locale]="zh" name="time_start"
                         [styleClass]="'schedule-add'" dateFormat="yy-mm-dd"  dataType="string"
                         [minDate]="minDate" [(ngModel)]="queryModel.time_start"  >
            </p-calendar>
          </div>
          <label class="ui-g-1 ui-sm-5 text-center" >至:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid ">
            <p-calendar  [showIcon]="true" [locale]="zh" name="end_time"
                         [styleClass]="'schedule-add'" dateFormat="yy-mm-dd"  dataType="string"
                         [minDate]="minDate" [(ngModel)]="queryModel.time_end" >
            </p-calendar>
          </div>
        </div>
        <div class="ui-g-4 ui-sm-12">
          <label  class="ui-g-3 ui-sm-5 text-right">状态:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid ">
            <p-dropdown [options]="MaterialStatusData" [(ngModel)]="queryModel.status" [autoWidth]="false" name="cycle" (onChange)="suggestInsepectiones()" ></p-dropdown>
          </div>
          <div class="ui-g-5 ui-sm-12 option">
            <button pButton type="button" label="查询" ngClass="ui-sm-12" (click)="suggestInsepectiones()" ></button>
            <button pButton  label="清空" ngClass="ui-sm-12"  (click)="clearSearch()"></button>
          </div>
        </div>
      </div>
  </div>
    </div>
  </div>

  <div class="ui-g ">
    <div class="ui-g-12 ui-md-12 ui-lg-12 ">
    <p-dataTable class="report" [value]="historyReportModel" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                   [totalRecords]="totalRecords" (onLazyLoad)="loadCarsLazy($event)" [stacked]="stacked" [responsive]="true" [editable]="true">
      <p-column  field="cid" header="单号" [sortable]="true" >
        <ng-template let-data="rowData" pTemplate="body" let-i="rowIndex">
          <span (click)="onOperate(data)" class="curser">{{data.cid}}</span>
        </ng-template>
      </p-column>
      <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}" [sortable]="true"></p-column>
        <p-column field="color" header="操作" >
          <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
            <button pButton type="button" label="编辑" (click)="updateOption(dataSource[i])" *ngIf="dataSource[i]['status']==='新建'"></button>
            <button pButton type="button" label="删除" (click)="deleteReport(dataSource[i],i)" *ngIf="dataSource[i]['status']==='新建'"></button>
            <button pButton type="button" label="处理" (click)="showReportTreatmentMask(dataSource[i],i)"  *ngIf="dataSource[i]['status']==='未处理'"></button>
            <button pButton type="button" label="查看" (click)="showReport(dataSource[i])"></button>
          </ng-template>
        </p-column>
        <ng-template pTemplate="emptymessage">
          当前没有数据
        </ng-template>
      </p-dataTable>
    </div>
  </div>
</div>

<!--查看详情model-->
<app-view-detail
  [reportDetail]="currentHistoryReport"
  (closeViewDetail)="closeViewDetail($event)"
  *ngIf="showViewDetailMask" ></app-view-detail>
<!--报障处理-->
<app-report-treatment
  [reportTreatment]="currentHistoryReport"
  (closeReportTreatmentMask)="closeReportTreamentMask($event)"
  *ngIf="showReportTreatment" (updateDev)="updatehistoryReportModel($event)"></app-report-treatment>

